package com.xry.mapper;

import com.xry.bean.Product;
import com.xry.bean.Product;
import com.xry.util.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ProductDao {
    int add(@Param("param")Product product);

    int del(@Param("id") Integer id);

    int edit(@Param("param") Product product);

    List<Product> all(@Param("param") Product product);

    Product one(@Param("id") Integer id);

    int pageCount(@Param("param") Product product);

    List<Product> page(@Param("page") Page page, @Param("param") Product product);

    List<Map<String, Integer>> countBrand();

    List<Map<String, Integer>> countCategory();

    int delByBrand(@Param("brand_id") Integer brand_id);

    int delByCategory(@Param("category_id") Integer category_id);
}
